//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package org.pentaho.kettle.plugin.mqtt.ui.steps.producer;

import org.pentaho.kettle.plugin.mqtt.steps.producer.ProducerStepMeta;
import org.pentaho.ui.xul.XulEventSourceAdapter;

public class ProducerStepMetaMapper extends XulEventSourceAdapter {
    private static String PUB_BROKER = "pub_broker";
    private static String PUB_MESSAGE = "pub_message";
    private static String PUB_TOPIC = "pub_topic";
    private static String PUB_CLIENTID = "pub_clientid";
    private static String PQOS = "pqos";
    private String pBroker = "tcp://127.0.0.1:1883";
    private String pMessage = "";
    private String pTopic = "iotdevices";
    private String pClientId = "clientID";
    private int pQOS = 1;

    public ProducerStepMetaMapper() {
    }

    public void setpBroker(String args) {
        String previousVal = this.pBroker;
        this.pBroker = args;
        this.firePropertyChange(PUB_BROKER, previousVal, this.pBroker);
    }

    public void setpMessage(String arg) {
        String previousVal = this.pMessage;
        this.pMessage = arg;
        this.firePropertyChange(PUB_MESSAGE, previousVal, this.pMessage);
    }

    public void setpTopic(String arg) {
        String previousVal = this.pTopic;
        this.pTopic = arg;
        this.firePropertyChange(PUB_TOPIC, previousVal, this.pTopic);
    }

    public void setpClientId(String arg) {
        String previousVal = this.pClientId;
        this.pClientId = arg;
        this.firePropertyChange(PUB_CLIENTID, previousVal, this.pClientId);
    }

    public void setpQOS(int arg) {
        int previousVal = this.pQOS;
        this.pQOS = arg;
        this.firePropertyChange(PQOS, previousVal, this.pQOS);
    }

    public String getpBroker() {
        return this.pBroker;
    }

    public String getpMessage() {
        return this.pMessage;
    }

    public String getpClientId() {
        return this.pClientId;
    }

    public int getpQOS() {
        return this.pQOS;
    }

    public String getpTopic() {
        return this.pTopic;
    }

    public void loadMeta(ProducerStepMeta meta) {
        this.setpBroker(meta.getPubBroker());
        this.setpMessage(meta.getPubMessage());
        this.setpClientId(meta.getPubClientId());
        this.setpTopic(meta.getPubTopic());
        this.setpQOS(meta.getPubQos());
    }

    public void saveMeta(ProducerStepMeta meta) {
        meta.setPubBroker(this.getpBroker());
        meta.setPubQos(this.getpQOS());
        meta.setPubTopic(this.getpTopic());
        meta.setPubMessage(this.getpMessage());
        meta.setPubClientId(this.getpClientId());
        meta.setChanged();
    }
}
